import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/widgets/select/mixin/radio_mixin.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:finance_app/generated/a.dart';

class PayBillItemRadio extends StatelessWidget with RadioMixin {
  final String assertPath;
  final String title;
  final VoidCallback onTap;
  final bool isSelect;
  final VoidCallback onDelete;

  const PayBillItemRadio(
      {Key key,
      this.isSelect,
      this.assertPath,
      this.title,
      this.onTap,
      this.onDelete})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Stack(
      clipBehavior: Clip.none,
      children: [
        PressedOpacityButton(
          padding:
              EdgeInsets.symmetric(horizontal: getDp(19), vertical: getDp(21)),
          color: isSelect == true ? aceLightBlue : Colors.white,
          borderRadius: BorderRadius.circular(getDp(10)),
          border: isSelect == true
              ? Border.all(
                  color: aceBlueColor,
                  width: getDp(1),
                )
              : null,
          boxShadow: [
            BoxShadow(
              offset: Offset(0.0, getDp(4)),
              blurRadius: getDp(22),
              spreadRadius: -getDp(4),
              color: Colors.black.withOpacity(0.25),
            ),
          ],
          onPressed: onTap,
          child: Row(
            children: [
              buildSelectWidget,
              SizedBox(
                width: getDp(27),
              ),
              Expanded(
                child: Text(
                  title,
                  style: TextStyle(
                    color: aceBlackColor,
                    fontSize: getSp(16),
                    fontWeight:
                        isSelect == true ? FontWeight.w700 : FontWeight.w400,
                    height: 22 / 16,
                  ),
                ),
              ),
            ],
          ),
        ),
        Positioned(
            top: -getDp(10),
            right: -getDp(8),
            child: PressedOpacityButton(
              onPressed: onDelete,
              child: SvgPicture.asset(
                A.assetsImagesSettingRemove_1,
                width: getDp(25),
                height: getDp(25),
              ),
            )),
      ],
    );
  }
}
